// copyright jyz.2024
#pragma once

#include "CoreMinimal.h"
#include "AuraCharacterBase.h"
#include "AbilitySystem/Data/CharacterClassInfo.h"
#include "AuraRPGDemo/Interaction/EnemyInterface.h"
#include "UI/WidgetController/OverlayWidgetController.h"
#include "AuraEnemy.generated.h"


class UWidgetComponent;

UCLASS()
class AURARPGDEMO_API AAuraEnemy : public AAuraCharacterBase,public IEnemyInterface
{
	GENERATED_BODY()
public:
	AAuraEnemy();
	/** IEnemyInterface */
	virtual void SetHighlightActor(bool bIsHovered) override;
	/** End IEnemyInterface */

	/** Begin CombaInterface */
	virtual int32 GetCharacterLevel() const override;
	virtual void Die() override;
	/** End CombaInterface */
protected:
	virtual void BeginPlay() override;
	virtual void InitAbilityActorInfo() override;
	virtual void InitializeDefaultAttribute() override;
	UPROPERTY(VisibleAnywhere,BlueprintReadOnly)
	UWidgetComponent* HealthBarComp;

	UPROPERTY(BlueprintAssignable)
	FOnAttributeChangeSignature OnHealthDelegate;
	UPROPERTY(BlueprintAssignable)
	FOnAttributeChangeSignature OnMaxHealthDelegate;
private:
	UPROPERTY(EditAnywhere,BlueprintReadOnly ,meta=(AllowPrivateAccess=true),Category="Combat")
	int32 Level =1;
	UPROPERTY(EditAnywhere,BlueprintReadOnly ,meta=(AllowPrivateAccess=true),Category="Combat")
	ECharacterClass CharacterClass = ECharacterClass::Warrior;
	UPROPERTY(BlueprintReadOnly ,meta=(AllowPrivateAccess=true))
	bool bHitReacting = false;
	UPROPERTY(EditAnywhere,BlueprintReadOnly ,meta=(AllowPrivateAccess=true),Category="Combat")
	float BaseWalkSpeed = 250.f;
	UPROPERTY(EditAnywhere,BlueprintReadOnly ,meta=(AllowPrivateAccess=true),Category="Combat")
	float LifeSpan = 5.0f;
	
	void OnHitReactChange( const FGameplayTag Tag, int32 NewCount);
};
